;;******************** (C) COPYRIGHT 2023 Metanergy********************
;* file               : IAR_Startup_myg0025.s
;* author             : AE Team
;* Version            : V1.0.0
;* date               : 16.05.2023
;* Description        : myg0025 devices vector table for EWARM toolchain.
;*                      This module performs:
;*                      - Set the initial SP
;*                      - Set the initial PC == __iar_program_start,
;*                      - Set the vector table entries with the exceptions ISR 
;*                        address
;*                      - Configure the system clock
;*                      - Branches to main in the C library (which eventually
;*                        calls main()).
;*                      After Reset the Cortex-M0 processor is in Thread mode,
;*                      priority is Privileged, and the Stack is set to Main.
;*******************************************************************************

        MODULE  ?cstartup

        ;; Forward declaration of sections.
        SECTION CSTACK:DATA:NOROOT(3)

        SECTION .intvec:CODE:NOROOT(2)

        EXTERN  __iar_program_start
        EXTERN  SystemInit
        PUBLIC  __vector_table

        DATA
__vector_table
        DCD     sfe(CSTACK)
                DCD     Reset_Handler                  ; Reset Handler
                DCD     NMI_Handler                    ; NMI Handler
                DCD     HardFault_Handler              ; Hard Fault Handler
                DCD     0                              ; Reserved
                DCD     0                              ; Reserved
                DCD     0                              ; Reserved
                DCD     0                              ; Reserved
                DCD     0                              ; Reserved
                DCD     0                              ; Reserved
                DCD     0                              ; Reserved
                DCD     SVC_Handler                    ; SVCall Handler
                DCD     0                              ; Reserved
                DCD     0                              ; Reserved
                DCD     PendSV_Handler                 ; PendSV Handler
                DCD     SysTick_Handler                ; SysTick Handler

                ; External Interrupts
                DCD     WWDG_IRQHandler                ; Window Watchdog
                DCD     PVD_IRQHandler                 ; PVD
                DCD     RTC_IRQHandler                 ; RTC
                DCD     FLASH_IRQHandler               ; FLASH
                DCD     RCC_IRQHandler                 ; RCC
                DCD     EXTI0_1_IRQHandler             ; EXTI Line 0 and 1
                DCD     EXTI2_3_IRQHandler             ; EXTI Line 2 and 3
                DCD     EXTI4_15_IRQHandler            ; EXTI Line 4 to 15	  
                DCD     DMA_CH1_IRQHandler            ; DMA Channel 1
                DCD     DMA_CH2_3_IRQHandler          ; DMA Channel 2 and Channel 3
                DCD     DMA_CH4_5_IRQHandler          ; DMA Channel 4 and Channel 5 
                DCD     ADC_IRQHandler                 ; ADC1 
                DCD     TIM1_IRQHandler                ; TIM1
                DCD     UART1_IRQHandler               ; UART1
                DCD     TIM2_IRQHandler                ; TIM2
                DCD     TIM3_IRQHandler                ; TIM3
                DCD     TIM6_IRQHandler               ; TIM6
                DCD     I2C1_SPI1_IRQHandler           ; I2C2
                DCD     UART2_IRQHandler               ; UART2
                DCD     EMACC_IRQHandler               ; EMACC
                DCD     DVSQ_IRQHandler                ; DVSQ
                DCD     COMP1_COMP2_COMP3_COMP4_IRQHandler 	             ; COMP1 COMP2 COMP3 COMP4 
     
        
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Default interrupt handlers.
;;
        THUMB

        PUBWEAK Reset_Handler
        SECTION .text:CODE:NOROOT:REORDER(2)
Reset_Handler
        LDR     R0, =SystemInit
        BLX     R0
        LDR     R0, =__iar_program_start
        BX      R0
        
        PUBWEAK NMI_Handler
        SECTION .text:CODE:NOROOT:REORDER(1)
NMI_Handler
        B NMI_Handler
        
        
        PUBWEAK HardFault_Handler
        SECTION .text:CODE:NOROOT:REORDER(1)
HardFault_Handler
        B HardFault_Handler
       
        
        PUBWEAK SVC_Handler
        SECTION .text:CODE:NOROOT:REORDER(1)
SVC_Handler
        B SVC_Handler
       
        
        PUBWEAK PendSV_Handler
        SECTION .text:CODE:NOROOT:REORDER(1)
PendSV_Handler
        B PendSV_Handler
        
        
        PUBWEAK SysTick_Handler
        SECTION .text:CODE:NOROOT:REORDER(1)
SysTick_Handler
        B SysTick_Handler
        
        
        PUBWEAK WWDG_IRQHandler
        SECTION .text:CODE:NOROOT:REORDER(1)
WWDG_IRQHandler
        B WWDG_IRQHandler

	
	PUBWEAK PVD_IRQHandler
        SECTION .text:CODE:NOROOT:REORDER(1)
PVD_IRQHandler
        B PVD_IRQHandler
        PUBWEAK RTC_IRQHandler
        SECTION .text:CODE:NOROOT:REORDER(1)
RTC_IRQHandler
        B RTC_IRQHandler
       
        PUBWEAK FLASH_IRQHandler
        SECTION .text:CODE:NOROOT:REORDER(1)
FLASH_IRQHandler
        B FLASH_IRQHandler
        
                
        PUBWEAK RCC_IRQHandler
        SECTION .text:CODE:NOROOT:REORDER(1)
RCC_IRQHandler
        B RCC_IRQHandler
        
                
        PUBWEAK EXTI0_1_IRQHandler
        SECTION .text:CODE:NOROOT:REORDER(1)
EXTI0_1_IRQHandler
        B EXTI0_1_IRQHandler
        
                
        PUBWEAK EXTI2_3_IRQHandler
        SECTION .text:CODE:NOROOT:REORDER(1)
EXTI2_3_IRQHandler
        B EXTI2_3_IRQHandler
        
                
        PUBWEAK EXTI4_15_IRQHandler
        SECTION .text:CODE:NOROOT:REORDER(1)
EXTI4_15_IRQHandler
        B EXTI4_15_IRQHandler                      
        
        PUBWEAK DMA_CH1_IRQHandler
        SECTION .text:CODE:NOROOT:REORDER(1)
DMA_CH1_IRQHandler
        B DMA_CH1_IRQHandler   
 
        PUBWEAK DMA_CH2_3_IRQHandler
        SECTION .text:CODE:NOROOT:REORDER(1)
DMA_CH2_3_IRQHandler
        B DMA_CH2_3_IRQHandler 
        
        PUBWEAK DMA_CH4_5_IRQHandler
        SECTION .text:CODE:NOROOT:REORDER(1)
DMA_CH4_5_IRQHandler
        B DMA_CH4_5_IRQHandler 
 
        PUBWEAK ADC_IRQHandler
        SECTION .text:CODE:NOROOT:REORDER(1)
ADC_IRQHandler
        B ADC_IRQHandler 
        
        PUBWEAK TIM1_IRQHandler
        SECTION .text:CODE:NOROOT:REORDER(1)
TIM1_IRQHandler
        B TIM1_IRQHandler       
        
        PUBWEAK UART1_IRQHandler
        SECTION .text:CODE:NOROOT:REORDER(1)
UART1_IRQHandler
        B UART1_IRQHandler

        PUBWEAK TIM2_IRQHandler
        SECTION .text:CODE:NOROOT:REORDER(1)
TIM2_IRQHandler
        B TIM2_IRQHandler
        

        PUBWEAK TIM3_IRQHandler
        SECTION .text:CODE:NOROOT:REORDER(1)
TIM3_IRQHandler
        B TIM3_IRQHandler
        
        PUBWEAK TIM6_IRQHandler
        SECTION .text:CODE:NOROOT:REORDER(1)
TIM6_IRQHandler
        B TIM6_IRQHandler  
        
        PUBWEAK I2C1_SPI1_IRQHandler
        SECTION .text:CODE:NOROOT:REORDER(1)
I2C1_SPI1_IRQHandler
        B I2C1_SPI1_IRQHandler 
        
                
        PUBWEAK UART2_IRQHandler
        SECTION .text:CODE:NOROOT:REORDER(1)
UART2_IRQHandler
        B UART2_IRQHandler


        PUBWEAK EMACC_IRQHandler
        SECTION .text:CODE:NOROOT:REORDER(1)
EMACC_IRQHandler
        B EMACC_IRQHandler


	PUBWEAK DVSQ_IRQHandler
        SECTION .text:CODE:NOROOT:REORDER(1)
DVSQ_IRQHandler
        B DVSQ_IRQHandler 
        
        PUBWEAK COMP1_COMP2_COMP3_COMP4_IRQHandler
        SECTION .text:CODE:NOROOT:REORDER(1)
COMP1_COMP2_COMP3_COMP4_IRQHandler
        B COMP1_COMP2_COMP3_COMP4_IRQHandler    
        
        END
;******************** (C) COPYRIGHT 2022 Metanergy********************
